/*
Copyright 2017 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef VR_SEURAT_COMPRESSOR_TEXTURE_ENCODER_H_
#define VR_SEURAT_COMPRESSOR_TEXTURE_ENCODER_H_

#include <vector>

#include "ion/gfx/image.h"
#include "absl/types/span.h"
#include "seurat/image/image.h"

namespace seurat {
namespace compressor {

// A possibly resized texture together with its bitrate and distortion values.
struct EncodedTexture {
  image::Image4f image;
  ion::gfx::Image::Format format;
  float rate;
  float distortion;
};

// TextureEncoder describes an interface for generating texture encodings with
// different bitrates.
class TextureEncoder {
 public:
  virtual ~TextureEncoder() = default;

  // Returns via |encodings| a vector of encoded versions for each texture in
  // the input array |textures|.
  virtual void Encode(
      absl::Span<const image::Image4f> textures,
      absl::Span<std::vector<EncodedTexture>> encodings) const = 0;
};

}  // namespace compressor
}  // namespace seurat

#endif  // VR_SEURAT_COMPRESSOR_TEXTURE_ENCODER_H_
